package com.itheima.day02;

//1. 定义一个类, 类名叫: VariableDemo02
public class VariableDemo02 {
    //2. 在类中定义main方法.
    public static void main(String[] args) {
        //定义一个新的person对象
        Person person = new Person();
        //设置对象的
        person.setName("云崖");
        person.setAge(22);
        person.setSex("男");
        person.setCareer("学生");
        person.setAddress("北京市昌平区北七家镇宏福科技园修正大厦");
        System.out.println("姓名：" + person.getName());
        System.out.println("年龄：：" + person.getAge());
        System.out.println("性别：" + person.getSex());
        System.out.println("职业：" + person.getCareer());
        System.out.println("住址：" + person.getAddress());
    }
}

//定义一个Person的匿名内部类
class Person {
    private String name;//定义一个String类型的变量, 变量名叫name,
    private int age;//定义一个int类型的变量, 变量名叫age,
    private String sex;//定义一个String 类型的变量, 变量名叫sex,
    private String career;//定义一个String 类型的变量, 变量名叫career,
    private String address;//定义一个String 类型的变量, 变量名叫address,

    public Person() {
    }

    public Person(String name, int age, String sex, String career, String address) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.career = career;
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
